/**
 * 
 */
package com.hexacta.hrs.test.data;

import static com.hexacta.hrs.test.data.EmployeeTestDataDependencyCreator.EMPLOYEE_1;

import java.util.List;
import java.util.Map;

import org.vectrics.employee.Employee;

import com.hexacta.hrs.familiarrelationship.FamiliarRelationShipTypes;
import com.hexacta.hrs.familiarrelationship.FamiliarRelationship;
import com.hexacta.hrs.util.Cuit;

/**
 * Test data creator for a FamiliarRelationship.
 * 
 * @author mfunes
 */
public class FamiliarRelationshipTestDataCreator extends AbstractTestDataCreator {

    public FamiliarRelationshipTestDataCreator(List<TestDataDependencyCreator> dependencies) {
        super(dependencies);
    }

    @Override
    protected Object internalCreateTestData(Map<String, Object> context) {
        FamiliarRelationship familiarRelationship = this.createFamiliarRelationship(context);
        return familiarRelationship;
    }

    private FamiliarRelationship createFamiliarRelationship(Map<String, Object> context) {
        Employee employee = (Employee) this.loadObjectFromContext(context, EMPLOYEE_1);
        FamiliarRelationship familiarRelationship = new FamiliarRelationship();
        familiarRelationship.setEmployee(employee);
        familiarRelationship.setBirthday(this.getDataUtils().createCurrentDate());
        familiarRelationship.setFamiliarRelationshipType(FamiliarRelationShipTypes.HIJO);
        familiarRelationship.setFullName("Nombre del Hijo");
        familiarRelationship.setCuilOrCuit(Cuit.generar(1, 'm'));
        familiarRelationship.setDni("00000001");
        return familiarRelationship;
    }
}
